package com.baidu.nacosconfig;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RefreshScope
public class ConfigController {
    @Value("${fd.name}")
    private String fdName;
    @Value("${fd.age}")
    private String fdAge;

    @RequestMapping("/getConfig")
    public String test() throws Exception
    {
        return "Get from Nacos fd.name:" + fdName + "fd.age:" + fdAge;
    }
}